package com.seadragon.apps.fashion.model;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "ITEM", schema = "STAGING")
public class Item {
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = IDENTITY)
	private long id;

	@Column(name = "DESCRIPTION")
	private String description;
	
	@Column(name = "NUMBER")
	private String number;
	
	@Column(name = "NAME")
	private String name;
	
	@Column(name = "ITEM_TYPE")
	private String type;

	@Column(name="URL")
	private String url;

	@Column(name="DATE_CREATED")
	private Date dateCreated;
	
	@Column(name="DATE_UPDATED")
	private Date dateUpdated;
	
	@Column(name="AVAILABLE")
	private boolean available;
	
	@OneToMany(mappedBy = "item", cascade = CascadeType.ALL, orphanRemoval = true)
	private List<Product> products;
	
	private List<Customer> subscribedCustomers;
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}

	public Date getDateUpdated() {
		return dateUpdated;
	}

	public void setDateUpdated(Date dateUpdated) {
		this.dateUpdated = dateUpdated;
	}

	public boolean isAvailable() {
		return available;
	}

	public void setAvailable(boolean available) {
		this.available = available;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<Product> getProducts() {
		return products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

}
